package c.h.a.k0.a;

import android.content.Context;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AlertController.b;
import b.b.c.f;
import c.h.a.m0.s.d;
import c.h.a.y.a;
import com.liuzh.deviceinfo.tests.TestesActivity;

/* compiled from: FlashlightTestFragment */
public class b0 extends a {
    public View W;
    public TestesActivity X;
    public d Y;

    public void D(Context context) {
        super.D(context);
        TestesActivity testesActivity = (TestesActivity) context;
        this.X = testesActivity;
        testesActivity.setTitle(2131689931);
    }

    public void E(Bundle bundle) {
        super.E(bundle);
        try {
            this.Y = new d(this.X);
        } catch (SecurityException unused) {
            if (VERSION.SDK_INT < 23) {
                f.a aVar = new f.a(this.X);
                aVar.e(2131690076);
                String string = s().getString(2131689930, new Object[]{x(2131689568)});
                b bVar = aVar.a;
                bVar.f = string;
                bVar.m = false;
                aVar.b(17039370, new j(this));
                aVar.a.n = new i(this);
                aVar.g();
                return;
            }
            this.X.finish();
        } catch (Exception unused2) {
            Toast.makeText(this.X, 2131689838, 0).show();
            this.X.finish();
        }
    }

    public View G(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        if (this.W == null) {
            this.W = layoutInflater.inflate(2131493072, viewGroup, false);
            if (m0()) {
                return this.W;
            }
            ((ImageView) this.W.findViewById(2131296633)).setImageResource(2131231120);
            ((TextView) this.W.findViewById(2131296715)).setText(2131689932);
            this.W.findViewById(2131296650).setOnClickListener(new l(this));
            this.W.findViewById(2131296653).setOnClickListener(new k(this));
        }
        return this.W;
    }

    public void H() {
        this.E = true;
        d dVar = this.Y;
        if (dVar != null) {
            dVar.a();
            c.h.a.m0.s.b bVar = this.Y.a;
            if (bVar != null) {
                bVar.release();
            }
        }
    }

    public void N() {
        this.E = true;
        d dVar = this.Y;
        if (dVar != null) {
            dVar.a();
        }
    }

    public void P() {
        this.E = true;
        try {
            c.h.a.m0.s.b bVar = this.Y.a;
            if (bVar != null) {
                bVar.b();
            }
        } catch (Exception unused) {
            Toast.makeText(this.X, 2131689838, 0).show();
        }
    }
}
